-
Notifications
You must be signed in to change notification settings - Fork 343
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding check if secureboot is enabled or not #5929
Conversation
Dear contributor,
The feature freeze will be active until the release planned on 05/06/2024. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@vaishnavibhat fix static fails make use of double qoutes here if '00000002' in line: |
avocado/utils/linux.py
Outdated
|
||
:return: True if secureboot is enabled, False if otherwise | ||
""" | ||
cmd = "lsprop /proc/device-tree/ibm,secure-boot" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @vaishnavibhat, can you please describe to me what lsprop
is and what it does, to be hones I am not familiar with it.
lsprop is a tool provided by powerpc-utils. It is used to get information about /proc files . For secureboot check: 0 incase of secure boot disabled, 1 (enable and log only - trusted boot) and 2 (enable and enforce - secure boot) #man lsprop NAME SYNOPSIS OVERVIEW DESCRIPTION OPTIONS
Linux Sep 2010 LSPROP(8) |
8837bff
to
e60b022
Compare
Hi @vaishnavibhat thank you for the description. So IIUIC the whole |
4c5792b
to
2623a72
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @vaishnavibhat, thank you for your update. IMO, it is on the right track. I just think that except Exception
is too general for this purpose, and we can be more specific. Please let me know what do you think about it.
avocado/utils/linux.py
Outdated
for line in process.system_output(cmd).decode("utf-8").splitlines(): | ||
if "00000002" in line: | ||
return True | ||
except Exception: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure if Exception
is not too general. When lsprop
is not in the system, the process.system_output(cmd) will throw
FileNotFoundError` am I right?
@vaishnavibhat Please fix the duplicate comit.. ammend the same do not create new commit |
The function checks if secureboot is enabled or not from the OS side. The command output of "lsprop /proc/device-tree/ibm,secure-boot" is used to check the OS status. Signed-off-by: Vaishnavi Bhat <[email protected]>
Resending the patch after taking care of the review comments. |
@richtja Please see if this is mergable |
@richtja Addressed the review comments. Please me know if this looks good. Thank you |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @vaishnavibhat, after the updates it LGTM. Thank you.
The function checks if secureboot is enabled or not from the OS side.
The command output of "lsprop /proc/device-tree/ibm,secure-boot" is used to check the OS status.